db32289c7b5bbc3e02cfc16c977a22cd8013c0e5,src/net/rithms/riot/api/StatsApi.java,StatsApi,getPlayerStatsSummary,#Region#Season#String#number#,33
Before Change
private static final String VERSION = "/v1.3/";
public static PlayerStatsSummaryList getPlayerStatsSummary(Region region, Season season, String key, long summonerId) throws RiotApiException {
String url = region.getEndpoint() + VERSION + "stats/by-summoner/" + summonerId + "/summary?api_key=" + key;
if (season != null) {
url += "&season=" + season;
}
PlayerStatsSummaryList summaryList = null;
try {
summaryList = new Gson().fromJson(Request.sendGet(url), PlayerStatsSummaryList.class);
} catch (JsonSyntaxException e) {
throw new RiotApiException(RiotApiException.PARSE_FAILURE);
}
if (summaryList == null) {
throw new RiotApiException(RiotApiException.PARSE_FAILURE);
}
return summaryList;
After Change
private static final String VERSION = "/v1.3/";
public static PlayerStatsSummaryList getPlayerStatsSummary(Region region, Season season, String key, long summonerId) throws RiotApiException {
Request request = new Request();
request.addToUrl(region.getEndpoint(), VERSION, "stats/by-summoner/", summonerId, "/summary?api_key=", key);
if (season != null) {
request.addToUrl("&season=", season);
}
request.execute();
PlayerStatsSummaryList dto = request.getDto(PlayerStatsSummaryList.class);
return dto;
}